package actions;

import java.util.List;
import org.apache.log4j.Logger;
import beans.User;

import com.opensymphony.xwork2.ActionSupport;

import controllers.AbstractController;


public class CreateUser extends ActionSupport {

	private static final long serialVersionUID = 1164809814839976523L;

	private static final Logger LOGGER = Logger.getLogger(CreateUser.class);

	
	// -------------------------------------------------------------
	// Objects
	// -------------------------------------------------------------

	AbstractController controller = new AbstractController();

	private String firstName;
	private String lastName;
	private String login;
	private String password;
	private String mail;
	private String idEntity;
	private String idRight;
	private String idStatus;
	
	private boolean result;
	
	
	// -------------------------------------------------------------
	// Methods
	// -------------------------------------------------------------

	public String execute() {
		System.out.println(getFirstName());
		System.out.println(getIdRight());
		setResult(controller.createUser(getFirstName(), getLastName(), getLogin(), getPassword(), getMail(), Integer.parseInt(getIdEntity()), Integer.parseInt(getIdRight()), Integer.parseInt(getIdStatus())));
		return SUCCESS;
	}


	public String getFirstName() {
		return firstName;
	}


	public void setFirstName(String firstName) {
		this.firstName = firstName;
	}





	public String getLastName() {
		return lastName;
	}





	public void setLastName(String lastName) {
		this.lastName = lastName;
	}





	public String getLogin() {
		return login;
	}





	public void setLogin(String login) {
		this.login = login;
	}





	public String getPassword() {
		return password;
	}





	public void setPassword(String password) {
		this.password = password;
	}





	public String getMail() {
		return mail;
	}





	public void setMail(String mail) {
		this.mail = mail;
	}





	public String getIdEntity() {
		return idEntity;
	}


	public void setIdEntity(String idEntity) {
		this.idEntity = idEntity;
	}


	public String getIdRight() {
		return idRight;
	}


	public void setIdRight(String idRight) {
		this.idRight = idRight;
	}


	public String getIdStatus() {
		return idStatus;
	}


	public void setIdStatus(String idStatus) {
		this.idStatus = idStatus;
	}


	public boolean isResult() {
		return result;
	}


	public void setResult(boolean result) {
		this.result = result;
	}





}
